Class UnaryInstruction<TValue, TValueType>
Base class for unary operator instructions with the same input and output types.
Assembly: WaaS.Core.dll
public abstract class UnaryInstruction<TValue, TValueType> : Instruction where TValue : unmanaged where TValueType : struct, IValueType<TValue>
Inheritance: System.Object
-> WaaS.Models.Instruction
Derived:
Expand
WaaS.Models.AbsF32, WaaS.Models.AbsF64, WaaS.Models.CeilF32, WaaS.Models.CeilF64, WaaS.Models.ClzI32, WaaS.Models.ClzI64, WaaS.Models.CtzI32, WaaS.Models.CtzI64, WaaS.Models.ExtendS16I32, WaaS.Models.ExtendS16I64, WaaS.Models.ExtendS32I64, WaaS.Models.ExtendS8I32, WaaS.Models.ExtendS8I64, WaaS.Models.FloorF32, WaaS.Models.FloorF64, WaaS.Models.NearestF32, WaaS.Models.NearestF64, WaaS.Models.NegF32, WaaS.Models.NegF64, WaaS.Models.PopcntI32, WaaS.Models.PopcntI64, WaaS.Models.SqrtF32, WaaS.Models.SqrtF64, WaaS.Models.TruncF32, WaaS.Models.TruncF64
Methods
Execute(WasmStackFrame)
Executes the instruction.
View Source
public override void Execute(WasmStackFrame current)
Parameters
Type | Name |
---|---|
WaaS.Runtime.WasmStackFrame | current |
Operate(TValue)
View Source
protected abstract TValue Operate(TValue value)
Returns
<TValue>
Parameters
Type | Name |
---|---|
<TValue> | value |
PreValidateStackState(in ValidationContext)
Get the number of values to pop and push from the stack to validate stack depth.
View Source
public override (uint popCount, uint pushCount) PreValidateStackState(in ValidationContext context)
Returns
System.ValueTuple<System.UInt32,System.UInt32>
Parameters
Type | Name |
---|---|
WaaS.Models.ValidationContext | context |
ValidateStackState(in ValidationContext, ref ValidationBlockStackState)
Simulates stack operations to validate the stack state.
View Source
public override void ValidateStackState(in ValidationContext context, ref ValidationBlockStackState stackState)
Parameters
Type | Name |
---|---|
WaaS.Models.ValidationContext | context |
WaaS.Models.ValidationBlockStackState | stackState |